Instantiation of Java Generics
نویسندگان
چکیده
Type parametrization is an essential construct in modern programming languages. On one hand, Java offers generics, on the other C++ templates for highly reusable code. The mechanism between these constructs differs and affects usage runtime performance, as well. uses type erasure, deals with instantiations.In this paper, we argue approach which similar to template construct. We evaluate performance of instantiated code present our tool able use generics templates. This generates source how improves generics.
منابع مشابه
Java generics and collections
class Fruit implements Comparable { protected String name; protected int size; protected Fruit(String name, int size) { this.name = name; this.size = size; } public boolean equals(Object o) { if (o instanceof Fruit) { Fruit that = (Fruit)o;
متن کاملSafe Instantiation in Generic Java
This paper presents the “safe-instantiation principle” a new design principle for evaluating extensions of Java with support for generic types. We discuss the GJ and NextGen formulations of Generic Java and the implications of safe instantiation on both approaches. We then consider the implications of safe-instantiation for the addition of mixins to Java via generic types. Finally, we defend th...
متن کاملVerification of Java Programs with Generics
Several proof systems allow the formal verification of Java programs, and a specification language was specifically designed for Java. However, none of these systems support generics that were introduced in Java 5. Generics are very important and useful when the collection framework (lists, sets, hash tables etc.) is used. Though they are mainly dealt with at compile time, they have some effect...
متن کاملSafe instantiation in generic Java
This paper presents the “Safe-Instantiation Principle,” a new design principle for evaluating extensions of Java with support for generic types. We discuss the GJ and NextGen formulations of Generic Java and the implications of safe instantiation on both approaches. We then consider the implications of safe-instantiation for the addition of mixins to Java via generic types. Finally, we defend t...
متن کاملSome Examples of Generics in Java 1.5
The forthcoming releases of Java JDK v1.5 and C# v2.0 support generic classes (classes with generic type parameters) and generic methods. Furthermore, each also supports constrained generic types. Much has been written about generic types. In " A Comparative Study of Language Support for Generic Programming " by Garcia et al details of generic types and programming in C++, Haskell, Standard ML,...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
ژورنال
عنوان ژورنال: Acta Cybernetica
سال: 2022
ISSN: ['2676-993X', '0324-721X']
DOI: https://doi.org/10.14232/actacyb.284073